package com.sailing.xjpb.dict.repository;

import com.sailing.xjpb.dict.entity.po.DictionaryPO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DictionaryRepository extends CrudRepository<DictionaryPO, String>, JpaSpecificationExecutor<DictionaryPO> {

    List<DictionaryPO> findAllByTypeAndPidOrderByOrder(String type, String pId);

    List<DictionaryPO> findAllByTypeAndEnabledOrderByOrderAsc(String type, String enabled);

    DictionaryPO findByTypeAndCode(String type, String code);

    List<DictionaryPO> findAllByPid(String pid);


}
